package com.some;

import java.util.Scanner;

public class BiTe01 {
    public long convert (String value) {
        // write code here
        return Integer.parseInt(value,16);
    }
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String str = sc.nextLine();
        System.out.println(Integer.parseInt(str,16));
    }
}
